import request from '@/utils/request'

export default {
    page(current, limit, role) {
        return request({
            url: `/acl/role/page/${current}/${limit}`,
            method: 'post',
            data: role
        })
    },

    get(id) {
        return request({
            url: `/acl/role/get/${id}`,
            method: 'get',
        })
    },

    save(role) {
        return request({
            url: `/acl/role/save`,
            method: 'put',
            params: { ...role }
        })
    },

    delete(ids) {
        return request({
            url: `/acl/role/delete`,
            method: 'delete',
            data: ids
        })
    },

    update(role) {
        return request({
            url: `/acl/role/update`,
            method: 'post',
            data: role
        })
    },

    getUserRole(userId) {
        return request({
            url: `/acl/role/getUserRole/${userId}`,
            method: 'get',
        })
    },

    endowedUserRole(userId, roleIds) {
        return request({
            url: `/acl/role/endowedUserRole/${userId}`,
            method: 'post',
            data: roleIds
        })
    }


}






